﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Admin_Client
{
    public partial class EditUser : Form
    {
        public EditUser()
        {
            InitializeComponent();
        }

        public void InitialazeEditUser(string[] arraySelectedUser)
        {
            this.UserIDTxtBox.Text = arraySelectedUser[0];
            this.FirstNameTxtBox.Text = arraySelectedUser[1];
            this.LastNameTxtBox.Text = arraySelectedUser[2];
            this.PasswordTxtBox.Text = arraySelectedUser[3];
            this.EmailTxtBox.Text = arraySelectedUser[4];
            this.PhoneTxtBox.Text = arraySelectedUser[5];
            this.LevelTextBox.Text = arraySelectedUser[6];
        }

        private void Submit_Click(object sender, EventArgs e)
        {
            User user = new User();
            user.EditUser(UserIDTxtBox.Text, FirstNameTxtBox.Text, LastNameTxtBox.Text, PasswordTxtBox.Text, LevelTextBox.Text, EmailTxtBox.Text, PhoneTxtBox.Text, WhoAmITxtBox.Text);
            this.Hide();
        }                
    }
}
